package user.classify;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.ArrayList;

import JDBC.DatabaseDao;
import vo.User;
import dao.UserDao;
import dao.StatusDao;


/**计算用户的interaction属性
 * @author Guo Liang
 *
 * 2013-11-28
 */
public class UserInteractionFeature{
	//Interaction相关的属性
	static int statuses_count;
	static int reposed_count;
	static int replied_count;
	static int AVE_URL;
	static int AVE_posts;
//	static ArrayList<User> users=new ArrayList<User>();
	
	public static void main(String []args){
	try{
		String sql="select top 100* from users where followers_count>1000" ;//Sinawler2数据库
				//" order by NewId()";//随机查询5000个用户，Sinaweibo数据库
		//SQL Server中NewID()函数将创建一个 unique identifier 类型的唯一值。
		Statement stmt=DatabaseDao.getConnection().createStatement();
		ResultSet rs=stmt.executeQuery(sql);
		while(rs.next()){
			
			User GaoKao_users=new User();
			GaoKao_users.setUserId(rs.getString("user_id"));
			GaoKao_users.setStatusesCount(rs.getInt("statuses_count"));
			System.out.println(GaoKao_users.getStatusesCount());
			reposed_count=UserDao.getRetweetCountByUserId(GaoKao_users.getUserId());
			//Sinaweibo数据库中有reposts_count一项
			System.out.println(reposed_count);
			
			
		}
		
	}catch (Exception e) {
		e.printStackTrace();
	}		
	}
	
}